pp108 : Using a Data Transformation Web Service in a Business Process Model

Using a Data Transformation Web Service in a Business Process Model

This topic describes the procedure to use a data transformation Web service in a business process model.

Data transformation converts data from a source data format into a destination data format. Data map is a model that captures the transformation logic between the source and destination data models. You can create a Web service that captures this logic and use it in a business process model.

  1. Create a data transformation model.
  2. Create a Web service to execute the data transformation model.
  3. Select a starting point and create a simple business process model.
  4. Drag the required application service (data transformation Web service) from the project content tree in Workspace Documents to the business process modeling environment to attach to the business process model. An input data transformation and output data transformation also appear under the business process model in the project content tree.
  5. Drag the input data transformation to the Start Event of the business process model.
  6. Drag the output data transformation to the End Event of the business process model.
  7. Right-click in the business process modeling environment and select Business Process Execution > Validate and generate BPML. Alternatively, go to Workspace Documents > <project>, right-click the <business process model> and select Business Process Execution > Validate and generate BPML. If there are no warnings, a status message appears indicating that there are no warnings. If there are warnings, the number of new warnings are displayed in the status bar. Resolve the errors and re-validate the process model.
  8. Right-click in the business process modeling environment and select Business Process Execution > Publish to Organization. Alternatively, go to Workspace Documents <project>, right-click the <business process model> and select Publish to Organization. The business process model is published to organization.
  9. Right-click in the business process modeling environment and select Business Process Execution > Run. The Start Message dialog appears. Enter the input parameter values and click OK. The business process model is instantiated.
  10. Right-click in the business process modeling environment and select Business Process Execution > Show Process Instances. The Instances by Process Definition window appears.
  11. In the Instances by Process Definition window, right-click Complete under Status column, and choose Show Start Message to view the source data XML format. Object Details dialog appears with the source data XML format. Similarly, choose Show End Message to view the converted destination data XML format. Object Details dialog appears with the transformed destination data XML format.
    The source data in one XML format is converted into another XML format by using a Data Transformation Web service in a business process model.

Example of using a Data Transformation in a Business Process Model

The following example describes the procedure to convert data of one XML format to another XML format. For example, you have a Source Template in the following XML format:

<employee_record>
    <employee_name/>
    <employee_number/>
    <employee_designation/>
</employee_record>

and a Target Template in the following XML format:

<emp_rec>
    <emp_name/>
    <emp_no/>
    <emp_desig/>
</emp_rec>

We can see that the Source Template has different field names to represent the same kind of data than that of the Target Template. For example, <employee name> in Source Template is <emp_name> in Target Template, and it implies to the remaining details. Create EmployeeDataTransformation, a data transformation, to convert data from Source Template XML format to Target Template XML format. Create a Web service to execute the data transformation and use it in a business process model.

Business Requirements

The business process should satisfy the following requirements:

  1. A Data Transformation model to convert data of one XML format to another XML format.
  2. A Web service to execute the data transformation.
  3. A business process model to use the data transformation model.
    Prerequisites
    Ensure that:
  4. A Source Template and Target Template are created.
  5. A Data Transformation model, EmployeeDataTransformation, is created and the Source Template and Target Template are mapped as shown below:
  6. A Web service, Employee Data Transformation, is created to use the data transformation in a business process model. You may note that when you create a Web service for the data transformation, an input, DataTransformation_EmployeeDataTransformationInput and output, DataTransformation_EmployeeDataTransformationOutput data transformations are also created.

Using the Data Transformation in a Business Process Model

  1. Create a simple business process model, DataTransformBPM as follows:
    1. Drag the created Employee Data Transformation onto the business process modeling environment. The DataTransformation_EmployeeDataTransformationInput and DataTransformation_EmployeeDataTransformationInput appear under the business process model in the project content tree.
    2. Drag the DataTransformation_EmployeeDataTransformationInput input data transformation on to Start event.
    3. Drag the DataTransformation_EmployeeDataTransformationOutput output data transformation on to the End event.
    4. The business process model appears as follows:
  2. Right-click in the business process modeling environment and select Business Process Execution > Validate and generate BPML. If there are any warnings they will be displayed in the Warning List pane.
  3. If there are no warnings, right-click in the business process modeling environment and select Business Process Execution > Publish to Organization.
  4. Right-click in the business process modeling environment and select Business Process Execution > Run. Start Message dialog appears. Enter the values as 1200, David, and Project Manager as parameters for employee_id, employee_name, and employee_designation as shown below:
  5. Click OK.
  6. Right-click in the business process modeling environment and select Business Process Execution > Show Process Instances. Instances by Process Definition window appears.
  7. In the Instances by Process Definition window, right-click Complete under Status column, and choose Show End Message to view the converted destination data XML format. Object Details dialog appears with the transformed destination data XML format:

    The source data in one XML format is converted into another XML format by using a Data Transformation Web service in a business process model.

Related tasks

Generating a Web Service Operation on a Data Transformation Model
Attaching Web Services to a Business Process Model